
$(function () {
    var goods_id = parseInt(GetQueryString('goods_id'));
    var html_data = {
        baseConfig: baseConfig,
        sessionid: '',
        sessionid_q: '',
        user_id: 0,
        goods_info:{},
        comment_list:[],
        value_list:[],
        start_list:[{type:1, index:0},{type:1, index:1},{type:1, index:2},{type:1, index:3},{type:1, index:4}],
        goods_order_item: []

    };
    var app = new Vue({
        el: '#address_modefy',
        data: html_data,
        methods: {
            price_filter: price_filter,

            first_name:function(realname){
                var title = realname.substring(0, 1);
                for (var i = 0; i < realname.length; i++) {
                    title += "*"
                }
                return title;
            },
            delete_goods_comment: function (info) {

                api.lgc.delete_goods_order_comment({goods_comment_id:info.id}).then(function (value) {
                    info.is_active=false;
                    Magiclamp.mcAlert("提示", "评论已删除");
                })
            },
            page_back: function () {
                baseConfig.page_back();
            }
        }
    });

    html_data.sessionid = GetQueryString('sessionid');
    if (html_data.sessionid) {
        html_data.sessionid_q = "sessionid=" + html_data.sessionid;
        client_storage('sessionid', html_data.sessionid);
    }


    if(goods_id){
        api.lgc.get_goods_comment_values({goods_id: goods_id}).then(function (data) {

            html_data.user_id = data.result.user_id;
            html_data.goods_info = data.result;
            html_data.value_list = data.result.value_list;

        });
        api.lgc.query_goods_comment_list({goods_id: goods_id}).then(function (data) {

            html_data.comment_list = data.result.list;

        });
    }


});
